import Phaser from 'phaser'

import star from '../../assets/star.png'

import sky from '../../assets/sky.png'


export default class GameScene extends Phaser.Scene {

    constructor(){
        super({key: 'gameScene'})
        this.backgroudImg = null
        this.textStyle = {font: '20px Yahei', fill: '#000000', align: 'center'}
        this.sceneText = null
    }

    init(data) {
        this.cameras.main.setBackgroundColor('#ffffff')
    }

    preload() {
        console.log("game Scene")
        this.load.image('star', star)
        this.load.image('sky', sky)
    }


    create(data) {
        // this.backgroudImg = this.add.sprite(0, 0, 'sky')
        // this.backgroudImg.x = 400
        // this.backgroudImg.y = 300


        this.sceneText  = this.add.text(400, 300, 'this is game scene', this.textStyle)
        this.sceneText.setOrigin(0.5, 0.5)

    }


    update(time,delta) {
        // if (time > 30000) {
        //     this.scene.switch("splashScene")
        // }
    }

}